package cglib;

import cglib.service.UserServiceInterceptor;
import entity.User;
import jdk.service.impl.UserServiceImpl;
import net.sf.cglib.proxy.Enhancer;

public class Client {
    public static void main(String[] args) {


        User user = new User();

        user.setName("1234");

        Enhancer enhancer = new Enhancer();

        enhancer.setSuperclass(UserServiceImpl.class);
        enhancer.setCallback(new UserServiceInterceptor());

        UserServiceImpl usil = (UserServiceImpl)enhancer.create();

        usil.addUser(user);




    }
}
